<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>angular函数库</title>
    <script src="./lib/angular.min.js"></script>
</head>
<body ng-app="wu">
<div ng-controller="ctrl">
    {{data}}
</div>
<script>
    var m = angular.module('wu', []);
    m.controller('ctrl', ['$scope', function (scope) {
        //console.log(angular.version);
        //console.log(angular.lowercase('baidu.COM'));
        //console.log(angular.uppercase('baidu.COM'));

        // 深层复制
        /*
         var obj = {'name':'你好'};
         var obj2 = {};
         angular.copy(obj,obj2);
         obj2.name = '明天';
         console.log(obj.name);
         */

        /*
         var obj = {'name':'你好'};
         angular.extend(obj,{'url':'baidu.com','web':'百度'});
         console.log(obj);
         */

        scope.data = [
            {'name': 'PHP', 'url': 'php.com'},
            {'name': 'Python', 'url': 'python.com'}
        ];
        angular.forEach(scope.data, function (v, k) {
            v.url = 'www.'+v.url;
        });


    }]);
</script>
</body>
</html>